package single;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class Test {
	public static void main(String []args) {
		DBcon dBcon= DBcon.getDBcon();
		PreparedStatement preparedStatement=null;
		ResultSet resultSet=null;
		Connection connection = dBcon.getConnection();
		try {
			preparedStatement = connection.prepareStatement(
					"select name,password from t_customer where name ='r'");
			preparedStatement.addBatch();
			preparedStatement.executeBatch();
			resultSet=preparedStatement.executeQuery();
		} catch (SQLException e1) { 
			e1.printStackTrace(); 
		}

		try {
			resultSet.next();
			System.out.println("name:"+resultSet.getString("name")+
					"   pwd:"+resultSet.getString("password"));
			connection.close();
		} catch (SQLException e) {}
		
	}

}
